﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace websitev2.Controllers
{
    public class TrophyCollectionController : Controller
    {
        //
        // GET: /TrophyCollection/
        public Models.StartStopEntities db = new Models.StartStopEntities();

        public ActionResult Index(string ID)
        {
            
            var user = db.ssUsers.FirstOrDefault(u => u.UserName == ID);




            #region load the generic user information
            // Load the general information 

            Models.UserGeneralInformationModel oUserGen = new Models.UserGeneralInformationModel();
            oUserGen = websitev2.Core.UserCore.LoadUserGen(user.UserGUID.GetValueOrDefault());
            ViewBag.UserGen = oUserGen;
            ViewBag.MediumAvatar = Core.UserCore.ReturnAvatarURL(user.UserGUID.GetValueOrDefault(), 1);
            #endregion


            return View();
        }

        public new  ActionResult User(string ID)
        {

            var user = db.ssUsers.FirstOrDefault(u => u.UserName == ID);


            StartStop.ServiceResources.UserTrophy[] oTrophies = StartStop.Helpers.Trophy.ReturnUserTrophy(user.UserID, 100000, true, true);  

            #region load the generic user information
            // Load the general information 

            Models.UserGeneralInformationModel oUserGen = new Models.UserGeneralInformationModel();
            oUserGen = websitev2.Core.UserCore.LoadUserGen(user.UserGUID.GetValueOrDefault());
            ViewBag.UserGen = oUserGen;
            ViewBag.MediumAvatar = Core.UserCore.ReturnAvatarURL(user.UserGUID.GetValueOrDefault(), 1);
            #endregion


            return View(oTrophies); 
        }

    }
}
